Ext.ns("Ext.stock") ;
/*******start******************************树状列表**********start****************/
var treeGrid = new Ext.ux.tree.TreeGrid({
        width: 320,
        height: 400,
        border:false,    
        columns:[{
            header: '仓库名称',
            dataIndex: 'text',
            width: 210
        },{
            header: '库存数量',
            width: 100,
            dataIndex: 'nums',
            align: 'center'
        }],
        tbar:[
			{
				text:"刷新",
				iconCls:"ref",
				handler:function(){
					treeGrid.getRootNode().reload() ;
		}
		}
		],
		listeners:{
			click:function(_node){
				if(_node.isLeaf()){
					Ext.getCmp("stockCheckAndStorageId").subStockCheckAndStorage_StockId = _node.id ;
					
//alert(Ext.getCmp("stockCheckAndStorageId").stockCheckAndStorage_StockId) ;
					var tempTxt = _node.text ;
					while(null != _node.parentNode && _node.parentNode.text != "Root"){
						_node = _node.parentNode ;
						tempTxt = _node.text + "->" + tempTxt ;
					}	
					Ext.getCmp("stockCheckAndStorage_StockId").setValue(tempTxt) ;
					Ext.getCmp("stock-OnlyTreeGrid-win").close() ;
				}else{
					_node.expand() ;
				}
				
			},
			close:function(){
				this.setDisabled(false) ;
			},
			scope:this
		},
        dataUrl: weburl + 'swarehouse/index'
    });

/*******end******************************树状列表**********end****************/

/*****start*************************仓库管理主界面*****************start*****/
Ext.stock.StockOnlyTreeGrid = Ext.extend(Ext.Panel,{
	repositoryManageLeftTree:null,	
	constructor:function(_cfg){
		Ext.apply(this,_cfg || {}) ;
		Ext.stock.StockOnlyTreeGrid.superclass.constructor.call(this,{
			items:[
				treeGrid
			]
		}) ;
	}
	
}) ;
/*****end*************************仓库管理主界面*****************end*****/








